webpackJsonp([17],{

/***/ "4Ezm":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });

// EXTERNAL MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=script&index=0!./src/apps/security-risk/detail.vue
var detail = __webpack_require__("jqN8");

// CONCATENATED MODULE: ./node_modules/_vue-loader@13.7.3@vue-loader/lib/template-compiler?{"id":"data-v-9e43006c","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=template&index=0!./src/apps/security-risk/detail.vue
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('yt-page',{attrs:{"title":"风险详情","scroll":""}},[_c('yt-card',{attrs:{"title":"基本信息"}},[_c('yt-cell',{attrs:{"label":"工艺/单元","value":_vm.item.name}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"场所/环节/部位","labelWidth":"200px","value":_vm.item.address}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"危险和有害因素类别","labelWidth":"200px","value":_vm.item.genre}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"事故类型","value":_vm.item.type}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"登记时间","value":_vm.item.time}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"危险源辨识内容","labelWidth":"30%","value":_vm.item.des}}),_vm._v(" "),(_vm.item.gridId)?_c('yt-cell',{attrs:{"label":"所属网格","labelWidth":"30%","value":_vm.item.gridId.attributes.name}}):_vm._e(),_vm._v(" "),(_vm.item.gridId)?_c('yt-cell',{attrs:{"label":"周边设备","isLink":""},on:{"click":_vm.goDevicePage}}):_vm._e(),_vm._v(" "),(_vm.item.gridId)?_c('yt-cell',{attrs:{"label":"周边视频","isLink":""},on:{"click":_vm.goVideoPage}}):_vm._e()],1),_vm._v(" "),_c('yt-card',{attrs:{"title":"风险评估"}},[_c('yt-cell',{attrs:{"label":"评估标准","value":_vm.item.criteria}}),_vm._v(" "),_vm._l((_vm.item.contents),function(obj,index){return _c('yt-cell',{key:index,attrs:{"labelWidth":"200px","label":_vm.getLabel(index),"value":obj.name}})})],2),_vm._v(" "),_c('yt-card',{attrs:{"title":"评估结果"}},[_c('yt-cell',{attrs:{"label":"风险值","value":_vm.getScore}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"风险等级","value":_vm.item.level}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"风险描述","value":_vm.getDesc}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"可视级别"}},[(_vm.item.level === '1级')?_c('span',{staticClass:"yt-rate-item"},[_c('i',{staticClass:"yt-icon yt-rate-icon icon-star-on",staticStyle:{"color":"red"}})]):_vm._e(),_vm._v(" "),(_vm.item.level === '2级')?_c('span',{staticClass:"yt-rate-item"},[_c('i',{staticClass:"yt-icon yt-rate-icon icon-star-on",staticStyle:{"color":"orange"}})]):_vm._e(),_vm._v(" "),(_vm.item.level === '3级')?_c('span',{staticClass:"yt-rate-item"},[_c('i',{staticClass:"yt-icon yt-rate-icon icon-star-on",staticStyle:{"color":"yellow"}})]):_vm._e(),_vm._v(" "),(_vm.item.level === '4级')?_c('span',{staticClass:"yt-rate-item"},[_c('i',{staticClass:"yt-icon yt-rate-icon icon-star-on",staticStyle:{"color":"blue"}})]):_vm._e()])],1),_vm._v(" "),_c('yt-card',{attrs:{"title":"管控信息"}},[_c('yt-cell',{attrs:{"label":"负责部门","value":_vm.item.department}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"负责人","value":_vm.item.responsible}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"管控级别","value":_vm.item.grade}}),_vm._v(" "),_c('yt-textarea',{attrs:{"disabled":"","title":"管控措施","border":"half"},model:{value:(_vm.item.control),callback:function ($$v) {_vm.$set(_vm.item, "control", $$v)},expression:"item.control"}})],1)],1)}
var staticRenderFns = []
var esExports = { render: render, staticRenderFns: staticRenderFns }
/* harmony default export */ var security_risk_detail = (esExports);
// CONCATENATED MODULE: ./src/apps/security-risk/detail.vue
function injectStyle (ssrContext) {
  __webpack_require__("d7tx")
}
var normalizeComponent = __webpack_require__("C7Lr")
/* script */


/* template */

/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = "data-v-9e43006c"
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  detail["a" /* default */],
  security_risk_detail,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)

/* harmony default export */ var apps_security_risk_detail = __webpack_exports__["default"] = (Component.exports);


/***/ }),

/***/ "d7tx":
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),

/***/ "jqN8":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__ = __webpack_require__("lC5x");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise__ = __webpack_require__("rVsN");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_slicedToArray__ = __webpack_require__("KH7x");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_slicedToArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_slicedToArray__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_asyncToGenerator__ = __webpack_require__("J0Oq");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_asyncToGenerator___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_asyncToGenerator__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_core_js_object_values__ = __webpack_require__("MgeX");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_core_js_object_values___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_core_js_object_values__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__common_api_commonApi_js__ = __webpack_require__("+/+p");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__common_utils_index_js__ = __webpack_require__("dh3M");





//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//



/* harmony default export */ __webpack_exports__["a"] = ({
  data: function data() {
    return {
      item: {},
      criteriaObj: null,
      xing: 5,
      xingColors: ['red', 'yellow', 'blue', 'green']
    };
  },

  computed: {
    getScore: function getScore() {
      var _this = this;

      var _default = 0;
      if (!this.item.contents || !this.criteriaObj) return _default;
      var contents = __WEBPACK_IMPORTED_MODULE_4_babel_runtime_core_js_object_values___default()(this.item.contents);
      if (contents.length === 0) return _default;
      var rules = this.criteriaObj.rules;
      var results = contents.forEach(function (v, index) {
        var _contdent = _this.criteriaObj.contents[index];
        rules = rules.replace(_contdent.alias, v.score);
      });
      var score = 0;
      try {
        score = eval(rules);
      } catch (e) {}
      return score;
    },
    getDesc: function getDesc() {
      var _this2 = this;

      if (!this.criteriaObj) return '';
      var obj = this.criteriaObj.grades.find(function (v) {
        return v.name === _this2.item.level;
      });
      return obj ? obj.desc : '';
    }
  },
  activated: function activated() {
    this.getData();
  },

  methods: {
    getLabel: function getLabel(index) {
      if (!this.criteriaObj) return '';
      var item = this.criteriaObj.contents[index];
      return item ? item.name : '';
    },
    getData: function getData() {
      var _this3 = this;

      return __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_asyncToGenerator___default()( /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.mark(function _callee() {
        var items, item, p, _ref, _ref2, criteriaObj, disasterDic, riskTypeDic, Hierarchy, list;

        return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_regenerator___default.a.wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                _context.next = 2;
                return __WEBPACK_IMPORTED_MODULE_5__common_api_commonApi_js__["a" /* commonApi */].search('security_risk_corporate', { equalTo: { objectId: _this3.$route.query.objectId }, include: ['gridId'] });

              case 2:
                items = _context.sent;
                item = items[0];
                p = [__WEBPACK_IMPORTED_MODULE_5__common_api_commonApi_js__["a" /* commonApi */].searchById('SecurityRiskControlCriteria', item.criteria), __WEBPACK_IMPORTED_MODULE_5__common_api_commonApi_js__["a" /* commonApi */].dictionary('disaster'), __WEBPACK_IMPORTED_MODULE_5__common_api_commonApi_js__["a" /* commonApi */].dictionary('risk_type'), __WEBPACK_IMPORTED_MODULE_5__common_api_commonApi_js__["a" /* commonApi */].dictionary('Hierarchy')];
                _context.next = 7;
                return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.all(p);

              case 7:
                _ref = _context.sent;
                _ref2 = __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_slicedToArray___default()(_ref, 4);
                criteriaObj = _ref2[0];
                disasterDic = _ref2[1];
                riskTypeDic = _ref2[2];
                Hierarchy = _ref2[3];
                list = [{
                  D_text: criteriaObj.name,
                  D_code: criteriaObj.id
                }];

                _this3.criteriaObj = criteriaObj;
                _this3.item = Object(__WEBPACK_IMPORTED_MODULE_6__common_utils_index_js__["d" /* ReplaceDictionary */])(item, { type: disasterDic, genre: riskTypeDic, criteria: list, grade: Hierarchy });

              case 16:
              case 'end':
                return _context.stop();
            }
          }
        }, _callee, _this3);
      }))();
    },
    goDevicePage: function goDevicePage() {
      this.$router.$push({ path: '/security-risk/detail/device', query: { gridId: this.$route.query.gridId } });
    },
    goVideoPage: function goVideoPage() {
      this.$router.$push({ path: '/security-risk/detail/video', query: { gridId: this.$route.query.gridId } });
    }
  }
});

/***/ })

});